Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save statistics of level attempts #340

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

vsnunes
Copy link

@vsnunes vsnunes commented Aug 25, 2023

These changes save how many times the player completes, timeouts, or falls on a given level.

My motivation was to find out which levels were the toughest for me (the ones with the highest timeouts and falls)

It supports score files without any statistics so you don't need to restart your game progress but it will start adding them to the files as soon as you complete or fail a level. Back up your scores folder before testing this so you can easily revert.

@parasti
Copy link
Member

parasti commented Aug 26, 2023

This is cool.

@parasti
Copy link
Member

parasti commented Aug 26, 2023

I only had a quick glance, and there's one thing that sticks out to me and this is related to the file format itself: What if you wanted to track more stats in the future? What if you wanted to remove a stat in the future? You have encoded the three stats as an array of numbers, which is order-dependent and you've forever reserved indices 0, 1 and 2 for those stats. I think they should be key-value pairs instead, which would make them order-independent and more flexible.

@vsnunes
Copy link
Author

vsnunes commented Aug 28, 2023

What if you wanted to track more stats in the future? What if you wanted to remove a stat in the future?

Good point. I'll change that. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants